home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / DATABASE.DIR / 00094_Script_PRINT TEXT < prev    next >
Text File  |  1996-03-28  |  1KB  |  50 lines

  1. -- --------------------------------------------------------
  2. -- Handler printTopicText gets the name of the topic to print
  3. -- and then calls printText to print the topic.
  4.  
  5. on printTopicText
  6.   global printButton, browserTopicsLine, textSprite
  7.   
  8.   activateButtonThenEnable(printButton)
  9.   set textCastName = the name of cast the castNum of sprite textSprite
  10.   set whichTopic = word 1 to (the number of words in textCastName - 1) of textCastName
  11.   
  12.   printText(whichTopic)
  13. end
  14.  
  15. -- --------------------------------------------------------------
  16. -- Handler printText prints the text of the given topic.
  17.  
  18. on printText whichTopic
  19.   set theText = getAllTextInTopic(whichTopic)
  20.   
  21.   if (the machineType = 256) then
  22.     printTextFromPC(theText)
  23.   else
  24.     printTextFromMac(theText)
  25.   end if
  26. end
  27.  
  28. -- --------------------------------------------------------------
  29. -- Handler getAllTextInTopic returns all the text of the given
  30. -- topic by concatenating the text of the subfields.
  31.  
  32. on getAllTextInTopic whichTopic
  33.   global currentPage
  34.   
  35.   set theText = the text of field (whichTopic && "TEXT" & 1)
  36.   
  37.   set oldCurrentPage = currentPage
  38.   resetCurrentPage
  39.   
  40.   set nextPageCast = getNextPageCast(1)
  41.   repeat while (nextPageCast <> -1)
  42.     set theText = theText && the text of cast nextPageCast
  43.     updateCurrentPage(1)
  44.     set nextPageCast = getNextPageCast(1)
  45.   end repeat
  46.   
  47.   set currentPage = oldCurrentPage
  48.   
  49.   return theText
  50. end